package com.uduemc.biso.core.feign;

import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import com.uduemc.biso.core.extities.center.SysServer;
import com.uduemc.biso.core.feign.fallback.SysServerFeignFallback;
import com.uduemc.biso.core.utils.RestResult;

//@FeignClient(value = "SERVICE")
@FeignClient(value = "BISO-BASIC-SERVICE", fallbackFactory = SysServerFeignFallback.class)
@RequestMapping("/sys-server")
public interface SysServerFeign {

	@PostMapping("/insert")
	public RestResult insert(@RequestBody SysServer server);

	@PutMapping("/update-by-id")
	public RestResult updateById(@RequestBody SysServer server);

	@GetMapping("/find-all")
	RestResult findAll();

	@GetMapping("/find-ok-all")
	RestResult findOkAll();

	@GetMapping("/find-one/{id}")
	RestResult findOne(@PathVariable("id") Long id);

	@GetMapping("/find-ok-one/{id}")
	RestResult findOkOne(@PathVariable("id") Long id);

	@GetMapping("/delete-by-id/{id}")
	public RestResult deleteById(@PathVariable("id") long id);

	@GetMapping("/find-by-type-status/{type}/{status}")
	public RestResult findByTypeStatus(@PathVariable("type") int type, @PathVariable("status") short status);
}
